<template>
  <div style="margin-right:50px;">
    <el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="140px" class="demo-ruleForm"
             style="margin-top: 50px;" size="mini">
      <el-row>
        <el-col :span="8">
          <el-form-item label="产品组合:" prop="age">
            <el-select
              v-model="ruleForm.t8_sys_portfol_id"
              class="venus-input-middle"
              placeholder="--请选择产品组合--"
            >
              <el-option
                v-for="(item) in dict.t8_sys_portfol_id"
                :key="item.value"
                :label="item.text"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="产品/SPV:" prop="age">
            <el-select
              v-model="ruleForm.t8_prod_info_id"
              class="venus-input-middle"
              placeholder="--请选择产品/SPV--"
            >
              <el-option
                v-for="(item) in dict.t8_prod_info_id"
                :key="item"
                :label="item"
                :value="item"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="产品/SPV余额(元):" prop="age">
            <el-input v-model="ruleForm.prod_principalbln"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="交易日期:" prop="age">
            <el-date-picker
              v-model="ruleForm.tradedate"
              type="date"
              class="venus-input-middle venus-input-date"
              placeholder="请选择交易日期"
              value-format="yyyyMMdd"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="交易市场:" prop="age">
            <el-select
              v-model="ruleForm.marketplaceid"
              class="venus-input-middle"
              placeholder="--请选择交易市场--"
            >
              <el-option
                v-for="(text,key) in dict.marketplaceid"
                :key="key"
                :label="text"
                :value="key"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="回购方向:" prop="age">
            <el-select
              v-model="ruleForm.direction"
              class="venus-input-middle"
              placeholder="--请选择回购方向--"
            >
              <el-option
                v-for="(text,key) in dict.direction"
                :key="key"
                :label="text"
                :value="key"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="业务品种:" prop="age">
            <el-select
              v-model="ruleForm.trans_breed"
              class="venus-input-middle"
              placeholder="--业务品种--"
            >
              <el-option
                v-for="(text,key) in dict.trans_breed"
                :key="key"
                :label="text"
                :value="key"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="回购期限(天):" prop="age">
            <el-input v-model="ruleForm.repodays"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="回购利率(%)" prop="age">
            <el-input v-model="ruleForm.dealrate"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="首次交收日:" prop="age">
            <el-date-picker
              v-model="ruleForm.settlementbegindate"
              type="date"
              class="venus-input-middle venus-input-date"
              placeholder="请选择首次交收日"
              value-format="yyyyMMdd"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="到期结算日:" prop="age">
            <el-date-picker
              v-model="ruleForm.maturitydate"
              type="date"
              class="venus-input-middle venus-input-date"
              placeholder="请选择结算日期"
              value-format="yyyyMMdd"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="应计利息(元)" prop="age">
            <el-input v-model="ruleForm.interestamount"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="到期结算金额(元)" prop="age">
            <el-input v-model="ruleForm.maturegrossamount"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="到期交收日:" prop="age">
            <el-date-picker
              v-model="ruleForm.settlementenddate"
              type="date"
              class="venus-input-middle venus-input-date"
              placeholder="请选择到期交收日"
              value-format="yyyyMMdd"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="实际占款天数:" prop="age">
            <el-input v-model="ruleForm.tenor"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="手续费(元):" prop="age">
            <el-input v-model="ruleForm.tax"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="对方席号:" prop="age">
            <el-input v-model="ruleForm.adverse_seats"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="约定编号:" prop="age">
            <el-input v-model="ruleForm.contract_number"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="资金账号:" prop="age">
            <el-select
              v-model="ruleForm.account_code"
              class="venus-input-middle"
              placeholder="--请选择资金账号--"
            >
              <el-option
                v-for="(item) in dict.account_code"
                :key="item.value"
                :label="item.text"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="资金账户名称:" prop="age">
            <el-input v-model="ruleForm.account_name"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="开户行名称:" prop="age">
            <el-input v-model="ruleForm.opening_account_name"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="开户行行号:" prop="age">
            <el-input v-model="ruleForm.opening_account_num"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="备注:" prop="age">
            <el-input v-model="ruleForm.note"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <div style="text-align:center">
        <el-button type="success" @click="">提交</el-button>
        <el-button type="info" @click="">重置</el-button>
      </div>
    </el-form>
  </div>
</template>
<style>

</style>
<script>
  import * as kk from "../../../../../../utils/k-utils";
  import request from "../../../../../../utils/request";

  export default {
    name: 'M82F02B002',
    data() {
      return {
        dict: {
          t8_sys_portfol_id: {},//产品组合
          t8_prod_info_id: {},//产品/SPV
          valuedays: {},//清算速度
          marketplaceid: {},//市场
          account_code: {},//资金账号
          trans_breed: {},//交易品种
          direction: {},//回购方向
        },
        ruleForm: {
          t8_sys_portfol_id: '',//产品组合
          t8_prod_info_id: '',//产品/SPV
          prod_principalbln: '',//产品/SPV余额(元)
          tradedate: '',//交易日期
          valuedays: '',//清算速度
          marketplaceid: '',//市场
          interest: '',//应计利息(元)
          note: '',//备注
          account_code: '',//资金账号
          account_name: '',//资金账户名称
          opening_account_name: '',//开户行名称
          opening_account_num: '',//开户行行号
          repodays: '',//回购期限(天)
          dealrate: '',//回购利率(%)
          interestamount: '',//应计利息(元)
          maturegrossamount: '',//首次结算方式
          maturitydate: '',//到期结算日
          tenor: '',//实际占款天数
          trans_breed: '',//交易品种
          direction: '',//回购方向
          settlementbegindate: '',//首次交收日
          settlementenddate: '',//到期交收日
          tax: '',//手续费(元)
          adverse_seats: '',//对方席号
          contract_number: '',//约定编号
        },
        rules: {}
      };
    },
    mounted() {
      // 初始化调用
      this.init()
    },
    methods: {
      init: function () {
        this.load_dict_exeid(this, 'public', 'selectPortfol', 't8_sys_portfol_id')
        this.load_dict_exeid(this, 'public', 'selectProd', 't8_prod_info_id')
        this.load_dict_exeid(this, 'public', 'selectAccByCondition', 'account_code')
        kk.k_load_dict(this, 'valuedays', 't8_clearing_speed');
        kk.k_load_dict(this, 'direction', 't8_exchange_market');
        kk.k_load_dict(this, 'marketplaceid', 't8_direction_repo');
      },
      /* 通过exeid加载字典 */
      load_dict_exeid(this_object, service_name, exeid, dict) {
        request({
          loading: true,
          url: service_name + '/base/comn-query.json?exeid=' + exeid,
          method: 'post'
        }).then(rep => {
          console.log(rep)
          this_object['dict'][dict] = rep.rows
        })
      },
    }
  }
</script>

<style scoped>
</style>
